home *** CD-ROM | disk | FTP | other *** search
- /*
- $VER: RandomTheme.dopus5 0.3 (23.10.98)
-
- Use it in the StartUp event or whereever you like, have it executed by Cron,
- (or Helmut's timer.module), to change every 30 minutes ;-)
-
- Call as: ARexx RandomTheme.dopus5 <port> [TOTAL]
-
- Run Async
-
- where: port = Opus ARexx port, {Qp} parameter if you're lazy.
- TOTAL = Keyword specifying the theme will be loaded in total, the
- alternative is to load random parts of it :-)
-
- REQUIRES: rexxtricks.library in Libs: available from Aminet as
- util/rexx/RexxTricks_386.lha
-
- */
- parse arg port args .
- options results
- if args = '' then args = port
- args = args ~= port
- if left(port,6) ~= 'DOPUS.' then do
- port = 'DOPUS.1'
- args = 1
- end
- address value upper(port)
- if ~show('l','rexxtricks.library') then
- if ~addlib('rexxtricks.library',0,-30) then exit
-
- call getdir('D5Themes:','#?.theme','themes','f','n')
- if themes.0 = 0 then exit
- x = rand(1,themes.0)
-
- appargs = ''
- do while length(appargs) ~> 1
- if rand(1,10) > 5 then appargs = appargs||'APPLYSOUNDS '
- if rand(1,10) > 5 then appargs = appargs||'APPLYFONTS '
- if rand(1,10) > 5 then appargs = appargs||'APPLYPALETTE '
- if rand(1,10) > 5 then appargs = appargs||'APPLYBACKGROUNDS '
- end
- appargs = strip(appargs)
-
- if args then
- command 'LoadTheme 'themes.x' APPLYSOUNDS APPLYFONTS APPLYPALETTE APPLYBACKGROUNDS'
- else
- command 'LoadTheme 'themes.x' 'appargs
- exit
-